#include <iostream>
#include <vector>

using namespace std;
 
int main()
{

    vector<int> v;
    int i;
    char cont='y';
    while(cin>>i){
        v.push_back(i);
        cout<<"继续输入请按Y"<<endl;
        cin>>cont;
        if(cont!='y'&&cont!='Y')
            break;
    }
    for(int i=1;i<v.size();i++){
        cout<<v[i-1]+v[i]<<" ";
    }
    cout<<endl;
    int lo=0,hi=v.size();
    while(lo<hi){
        cout<<v[lo++]+v[--hi]<<" ";
    }

    
}